<?php include (TEMPLATEPATH . '/wpress_defaults.php'); ?>
<?php get_header(); ?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<div class="menu_shadow_top"></div> <!-- menu top shadow -->
<div class="table_top"></div><!-- table top corners -->

<!-- begin portfolio container -->
<div id="portfolio">

	<!-- begin portfolio title -->
	<div class="title_container">
		<div class="title">
			<?php include (TEMPLATEPATH . '/wpress_shortcut.php'); ?>
		</div>
		
		<div class="back_btn">
			<a href="javascript:history.go(-1);"><?php echo get_option('back_name', $wp_back_name); ?></a>
		</div>
		
	</div>
	<!-- end portfolio title -->

<?php
  if($post->post_parent) {
  $children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->post_parent."&echo=0");
  }

  else {
  $children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->ID."&echo=0");
  }

  if ($children) { 
?>

	<!-- begin portfolio container -->		
	<div class="portfolio_container">

		<!-- begin items container -->		
		<div class="items_container">	
	
				<!-- begin items container -->		
		<div class="details_container">
				
				<?php the_content(); ?>
				
		</div>
		<!-- end items container -->			

		</div>
		<!-- end items container -->		
		
		<!-- begin navigation -->
		<div class="navigation">
		
			<h4><?php echo get_option('sub_navigation', $wp_sub); ?></h4>
			<ul>
				<?php echo $children; ?>
			</ul>
			
		</div>
		<!-- end navigation -->

	</div>
	<?php } else { ?>
	
	
	<!-- begin portfolio container -->		
	<div class="portfolio_container">

		<!-- begin items container -->		
		<div class="details_container">
			
					<?php the_content(); ?>
	
		</div>
		<!-- end items container -->		

	</div>
	<!-- end portfolio container -->		

	
	<?php } ?>

</div>
<!-- end portfolio container -->
<div class="table_bottom"></div><!-- table bottom corners -->
<div class="side_shadow_bottom"></div><!-- slide show bottom shadow -->

<?php endwhile; endif;  ?>

<?php get_footer(); ?>